<template>
	<view>
<pagestatus v-if="status.code !=200" :status="status" 
v-on:btnclick="getDetail"
></pagestatus>
	<block v-else>
	<view class="article-content">
	<view class="b p10 title">查看图片</view>
<image style="width:690rpx;" mode="widthFix" lazy-load="true" 
@click="preview" 
:data-src="imgcdn+thread.hash+'.'+thread.ext"
:src="imgcdn+thread.hash+'.'+thread.ext"></image>
	<view class="huise">发布时间：{{thread.timestr}}</view>
	<yad  mode="main"></yad>
	</view>
	<block v-if="moredata.length>0">
	<view class="b p10">文章推荐</view>
	<block v-for="(newsitem,index2) in moredata" :key="index2">
	<mediaItem :newitem="newsitem" opentype="redirect"></mediaItem>
	<yad v-if="index2%6==4" mode="feed"></yad>
	</block>
	</block>
	</block>
	</view>
</template>

<script>
var __self=false;/*this的优化 */
var s = require('../../static/ysv8/chat.js');
var p = {
title: getApp().globalData.ysv8set.title,
id: 0,
img:getApp().globalData.ysv8set.img,
timglist:[]
}
	import mediaItem from '@/components/list.vue';
	import yad from '@/components/yad.vue'
	import pagestatus from '@/components/page-status.vue'
export default {
		components: {
			mediaItem,yad,pagestatus
		},
		data() {
			return {
anz: getApp().globalData.ysv8set.anz,
favbool: !1,
moredata: !1,
thread: false,
imgcdn: getApp().globalData.ysv8set.imgcdn,
imgswt: getApp().globalData.ysv8set.imgswt,
loadingType: "more",
    status:{
        loading:true,
        icon:'content',
        title:'页面加载中...',
        desc:'',
        showBtn:false,
        btnText:'',
        code:199
    },
				}
},onLoad: function(t) {
        if (!t.id) uni.navigateBack({});
        __self = this;
        p.id = t.id;
this.getDetail()
},onShareAppMessage: function() {
        return {
            title: p.title,
            content: p.title,
            path: "/pageb/pic/t?id=" + p.id,
            imageUrl: p.img
        }
},methods:{

    copytxt: function() {
       a='图片浏览'
        a = a.replace(/[|]*\n/, "");
        a = a.replace(/<\/?[^>]*>/g, "");
        a = a.replace(/&npsp;/gi, "");
        uni.setClipboardData({
            data: getApp().globalData.ysv8set.title2 + a + "\n"+getApp().globalData.ysv8set.www+'pic/' + p.id + ".html"
        })
    },
  
getDetail: function() {
uni.request({
            url: getApp().globalData.ysv8set.www + "pic/" + p.id + ".api",
            cloudCache:getApp().globalData.ysv8set.cloudCache,
            data: {},
            success: function(e) {
if ("200" != e.data.code)
return  uni.showModal({
    title: '错误提示',
    content: e.data["info"],
    confirmText: '确定',
    success() {
        uni.navigateBack({
            fail() {
                uni.redirectTo({
                    url: '/pages/ht/index'
                });
            }

        });
    }
});


e.data.thread_data["timestr"] = getApp().globalData.ysv8set.timeStamp2String(e.data.thread_data['btime'], !0);
__self.thread=e.data.thread_data,
__self.moredata=e.data.data,
__self.status={
title:'加载完成',
showBtn:false,
code:200
}



            },
fail: function() {
__self.status={
title:'网络错误',
desc:'网络连接错误',
showBtn:true,
btnText:'重新加载',
code:400
 }
            }
        })

    }, preview(z) {
		
    uni.previewImage({
            current: z.target.dataset.src,
            urls: [z.target.dataset.src]
        })
    },
}
}
</script>

<style>
@import url("/components/gaoyia-parse/parse.css");
</style>
